using System;
using System.Collections.Generic;
using System.Text;
using WozLib.UI.Ink.SketchCommands;
using System.Xml.Serialization;

namespace WozLib.WozCommands
{


  // used to be in WozLib
  //[XmlInclude(typeof(WozServerClientSendCommand))]
  //[XmlInclude(typeof(WozObjectContainerServerCommand))]
  //[XmlInclude(typeof(WozCommitChangesCommand))]
  //[XmlInclude(typeof(WozDiscardChangesCommand))]
  //[XmlInclude(typeof(WozScreenChangeNameCommand))]
  //[XmlInclude(typeof(WozSelectToolCommand))]
  //[XmlInclude(typeof(WozScreenSelectCommand))]
  //[XmlInclude(typeof(WozRealTimeOffCommand))]
  //[XmlInclude(typeof(WozRealTimeOnCommand))]
  //[XmlInclude(typeof(WozAutoCommitOffCommand))]
  //[XmlInclude(typeof(WozAutoCommitOnCommand))]
  //[XmlInclude(typeof(WozServerClientCommand))]

  // known derived class in WozLib are listed here for convience
  // external other derived classes must be registered with an 
  // xmlserializer before they can be serialized through a base class
  // as in serializing an array of WozServerCommands that includes
  // derived class from outside the WozLib
  [XmlInclude(typeof(RedoWozCommand))]
  [XmlInclude(typeof(UndoWozCommand))]
  public class WozCommand
  {
    [XmlAttribute("Timestamp")]
    public DateTime Timestamp
    {
      get { return _Timestamp; }
      
      set { _Timestamp = value; }

    } private DateTime _Timestamp;
    

    public WozCommand()
    {
      // timestamp the command
      // property can be overwritten with something more accurate or by the Xml DeSerializer
      Timestamp = DateTime.Now;
    }

    public virtual void Undo()
    {
      // nothing really to do here
      // this base class doesn't do anything but hold a timestamp
    }

    public virtual void Redo()
    {
      // nothing really to do here
      // this base class doesn't do anything but hold a timestamp
    }
  }
}
